package com.huawei.door;

import com.huawei.member.*;
import com.huawei.validate.Validate;
public class Check implements Validate {
    // 门禁预先存储的密码
    private static final String[] PASSWORD = { "123", "456", "789", "abc" };
    // 核对员工输入的密码
    @Override
    public boolean check(Staff staff) {
        String string = staff.input();// 录入员工输入的密码
        int count = 0;
        for (String str : PASSWORD) {
            // 将员工输入的密码与已有密码做匹配
            if (string.equals(str)) {
                count++;
            }
        }
        if (0 != count)
            return true;
        else
            return false;
    }
}